using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class education_information_lineMap : EntityTypeConfiguration<education_information_line>
    {
        public education_information_lineMap()
        {
            // Primary Key
            this.HasKey(t => t.education_information_line_id);

            // Properties
            this.Property(t => t.sub_title)
                .HasMaxLength(200);

            this.Property(t => t.content_type)
                .HasMaxLength(20);

            this.Property(t => t.train_place)
                .HasMaxLength(200);

            this.Property(t => t.train_teacher)
                .HasMaxLength(20);

            this.Property(t => t.image_name)
                .HasMaxLength(50);

            this.Property(t => t.document_name)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("education_information_line");
            this.Property(t => t.education_information_line_id).HasColumnName("education_information_line_id");
            this.Property(t => t.education_information_id).HasColumnName("education_information_id");
            this.Property(t => t.sub_title).HasColumnName("sub_title");
            this.Property(t => t.content).HasColumnName("content");
            this.Property(t => t.content_type).HasColumnName("content_type");
            this.Property(t => t.train_place).HasColumnName("train_place");
            this.Property(t => t.train_teacher).HasColumnName("train_teacher");
            this.Property(t => t.train_time).HasColumnName("train_time");
            this.Property(t => t.train_max_numbers).HasColumnName("train_max_numbers");
            this.Property(t => t.image_name).HasColumnName("image_name");
            this.Property(t => t.document_name).HasColumnName("document_name");
            this.Property(t => t.hits).HasColumnName("hits");

            // Relationships
            this.HasRequired(t => t.education_information)
                .WithMany(t => t.education_information_line)
                .HasForeignKey(d => d.education_information_id);

        }
    }
}
